<template>
    <el-form-item :label="item.setUpShowName" :prop="item.key" inline>
      <el-input
        :disabled="item.enableUpdate == 0 ? true : false"
        :value="value"
        v-if="item.htmlFormCategory==='text'"
        v-bind="$attrs" v-on="$listeners"
        :type="item.htmlFormCategory"
        @input="handleInput"
      >
      </el-input>
      <!--<el-input
        :value="value"
        v-if="item.htmlFormCategory==='num'"
        v-bind="$attrs" v-on="$listeners"
        type="text"
        @input="handleInput"
      ></el-input>-->
      <el-input-number
        v-if="item.htmlFormCategory==='num'"
        :disabled="item.enableUpdate == 0 ? true : false"
        :controls="false"
        :value="value"
        @input="handleInput"
      ></el-input-number>
    </el-form-item>
</template>

<script>
  export default {
    props: {
      item: {
        type: Object,
        required: true
      },
      value: {
        required: true
      }
    },
    name: "DynamicFormItem",
    data() {
      return {

      }
    },
    mounted() {
      /*this.setDefaultValue()*/
    },
    created(){
    },
    methods: {
      handleInput(value){
        this.$emit('input', value)
      }
    }
  }
</script>
